const initialState = { count: 1 };
export default function userReducer(state = initialState, { type, payload }) {
  switch (type) {
    case "add":
      return {
        ...state,
        count: state.count + payload,
      };
    case "des":
      return {
        ...state,
        count: state.count - payload,
      };
    default:
      return state;
  }
}
